<template>
    <div class="demo">
        <h2>学校名称：{{name}}</h2>
        <h2>地址：{{address}}</h2>
        <button @click="sendSchoolName">发送学校名称</button>
	</div>
</template>

<script>
    export default {
        name:'School',
        props:['getSchoolName'],
        data(){
           return {
            name:'广师大',
            address:'广州天河区'
           }
        },
        methods:{
            sendSchoolName(){
                this.getSchoolName(this.name)
            }
        }
    }
</script>
<style scoped>
    .demo{
        background-color: green;
    }
</style>